package com.quanquan.user.repository;

import com.quanquan.user.entity.ConsumptionQuota;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * 功能描述:满额规则
 *
 * @ClassName: ConsumptionQuotaRepository
 * @Author: xiaoqianh丶
 * @Date: 2019-06-06 10:27
 * @Version: V1.0
 */
public interface ConsumptionQuotaRepository extends JpaRepository<ConsumptionQuota, String>, JpaSpecificationExecutor<ConsumptionQuota> {


    /**
     * 查询所有未删除的满额规则
     * @param num
     * @return
     */
    public List<ConsumptionQuota> findAllByRemoveOrderByThreshoidDesc(Integer num);


    /**
     * 根据阀值查询满额规则
     * @param threshoid
     * @param num
     * @return
     */
    public List<ConsumptionQuota> findByThreshoidAndRemove(String threshoid ,Integer num);


    /**
     * 根据满额id查找满额规则
     * @param id
     * @param num
     * @return
     */
    public ConsumptionQuota findByIdAndRemove(String id ,Integer num);

}
